package com.cn.web.controller.Equipment;

import com.alibaba.fastjson2.JSONObject;
import com.cn.bean.vo.Equipment.BusinessDimensionConfiguration;
import com.cn.bean.vo.Equipment.ComponentBasicInformation;
import com.cn.service.server.Equipment.BusinessDimensionConfigurationService;
import com.cn.service.server.Equipment.ComponentBasicInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/CoInformation")
@Transactional
public class ComponentBasicInformationController {
    private final ComponentBasicInformationService componentBasicInformationService;

    @Autowired(required = false)
    public ComponentBasicInformationController(ComponentBasicInformationService componentBasicInformationService) {
        this.componentBasicInformationService = componentBasicInformationService;
    }

    @RequestMapping("/select/ComponentBasicInformation")
    @ResponseBody
    public List<ComponentBasicInformation> selectComponentBasicInformation(@RequestBody JSONObject jsonObject) {
        String input1 = jsonObject.getString("input1");
        String input2 = jsonObject.getString("input2");
        input1 = (input1 != null) ? input1 : "";
        input2 = (input2 != null) ? input2 : "";
        return componentBasicInformationService.selectComponentBasicInformation(input1,input2);
    }
}
